<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;

Route::group('factory', function () {
    // 需要猪厂签名验证
    Route::group(function () {
        //获取时间戳
        Route::post('index/timestamp', '\app\factory\controller\IndexController@timestamp');

        // 机器(上位机)
        // 获取机器信息
        Route::post('machine/info', '\app\factory\controller\MachineController@info');
        // 信息上报
        Route::post('machine/report', '\app\factory\controller\MachineController@report');

        // 猪栋
        // 新增/编辑
        Route::post('barn/add_edit', '\app\factory\controller\BarnController@addEdit');

        // 猪栏
        // 新增/编辑
        Route::post('fence/add_edit', '\app\factory\controller\FenceController@addEdit');
        // 当天饲料进食记录
        Route::post('fence_daily_eat/add_edit', '\app\factory\controller\FenceEatController@addEdit');
        // 饲料药盒信息上报
        Route::post('fence_feed_medicine/add_edit', '\app\factory\controller\FenceFeedMedicineController@addEdit');

        // 生猪
        // 新增/编辑
        Route::post('pig/add_edit', '\app\factory\controller\PigController@addEdit');
        // 生猪的批次
        Route::post('pig/batch', '\app\factory\controller\PigController@batch');
        // 新增/编辑生猪进食信息
        Route::post('pig_eat/add_edit', '\app\factory\controller\PigEatController@addEdit');
        // 新增/编辑生猪每日进食信息
        Route::post('pig_daily_eat/add_edit', '\app\factory\controller\PigDailyEatController@addEdit');
        // 新增/编辑生猪每日进食平均值信息
        Route::post('pig_avg_eat/add_edit', '\app\factory\controller\PigAvgEatController@addEdit');
        // 体重记录上报
        Route::post('pig_weight/report', '\app\factory\controller\PigWeightController@addEdit');
        // 体重记录上报
        Route::post('pig_weight_up/report', '\app\factory\controller\PigWeightUpController@addEdit');
        // 进出栏记录上报
        Route::post('in_out_barn/report', '\app\factory\controller\InOutBarnController@report');
        // 疫苗接种记录上报
        Route::post('vaccines_record/add_edit', '\app\factory\controller\VaccinesRecordController@addEdit');
        // 健康记录上报
        Route::post('pig_health/report', '\app\factory\controller\PigHealthController@report');

        // 异常分类
        // 新增/编辑
        Route::post('abnormal_type/add_edit', '\app\factory\controller\AbnormalTypeController@addEdit');

        // 异常
        // 新增/编辑
        Route::post('abnormal/add_edit', '\app\factory\controller\AbnormalController@addEdit');

        // 用户
        // 新增/编辑
        Route::post('user/add_edit', '\app\factory\controller\FactoryUserController@addEdit');

        // 消毒中心
        // 新增/编辑
        Route::post('disinfect/add_edit', '\app\factory\controller\DisinfectController@addEdit');

        // 保健记录
        // 新增/编辑
        Route::post('health_fitness/add_edit', '\app\factory\controller\HealthFitnessController@addEdit');

        // 疾病记录
        // 分类下拉选择
        Route::post('disease_category/select_list','\app\factory\controller\DiseaseCategoryController@selectList');
        // 新增/编辑
        Route::post('disease/add_edit', '\app\factory\controller\DiseaseController@addEdit');

        // 饲料
        // 新增/编辑
        Route::post('feed/add_edit', '\app\factory\controller\FeedController@addEdit');

        // 药盒
        // 新增/编辑
        Route::post('medicine_box/add_edit', '\app\factory\controller\MedicineBoxController@addEdit');

        // 药品
        // 新增/编辑
        Route::post('medicine/add_edit', '\app\factory\controller\MedicineController@addEdit');

        // 饲料计划
        // 新增/编辑 单天饲料计划
        Route::post('feed_plan/add_edit', '\app\factory\controller\FeedPlanController@addEdit');
        // 新增/编辑 14天饲料计划
        Route::post('fourteen_feed_plan/add_edit', '\app\factory\controller\FourteenFeedPlanController@addEdit');

    })->middleware(['check_factory_sign']);

});
